-- stone_skin
-- created by panyl
-- 状态： 石肤

return {
    fetchProps = function(who, status, condition)
        local reduceRate = tonumber(condition["reduce_damage"]);
        local floor      = tonumber(condition["floor"]);
        local endRound   = condition["end_round"];
        local props = {};
        local propId = PropM.getPropId("damage_by_floor");

        table.insert(props, { propId, floor, reduceRate, endRound, });

        -- 免疫伤害
        local invincible = condition["invincible"];
        if invincible then
            propId = PropM.getPropId("probability_invincible");
            table.insert(props, { propId, 1, invincible, endRound, });
        end

        return props;
    end,

    desc = function(who, status, condition)
        -- 获取状态描述
        local cfg = CombatStatusM.getStatusInfo(status);
        local desc = cfg.desc;

        -- 天赋额外效果
        local invincible = condition["invincible"];
        if invincible then
            desc = cfg.extra_desc;
            local append = math.modf(invincible / 10);
            desc = string.gsub(desc, "{append}", append);
        end

        -- 效果，百分比
        local value = condition["reduce_damage"];
        value = math.modf(value / 10);
        desc = string.gsub(desc, "{value}", value);

        return desc;
    end,
};
